cachedURLs
Type
function
Summary
Returns a list of the URLs that have been downloaded and copied to the cache using the load command.
Syntax
the cachedURLs
cachedURLs()
Description
Use the cachedURLs function to determine which files have been downloaded and are currently in the cache. A cached URL can be accessed more quickly than one that is not cached.
The cachedURLs function includes all URLs that you have successfully loaded with the load command. If an unsuccessful attempt has been made to load a URL, it does not appear in the cachedURLs. Only URLs whose URLStatus is "cached" appear in the cachedURLs.
Cached files consume memory. To release this memory after you are finished with a URL, use the unload command to remove it from the cache. You can use this handler to unload all URLs:
on unloadAll
repeat for each line tThisURL in the cachedURLs
unload URL tThisURL
end repeat
end unloadAll
The cachedURLs function is part of the Internet library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Internet" script library is selected.
Examples
the cachedURLs
if myURL is not among the lines of the cachedURLs then load myURL
Related
control structure: function
function: files, libURLErrorData, URLStatus, cachedURLs
glossary: LiveCode custom library, return, handler, download, cache, Standalone Application Settings, URL, standalone application, command, load
library: Internet library
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
web
Platforms
desktop
server